<div ng-controller="OrderClosedController as vm">
 <h1 class="page-title">历史运单<a class="btn pull-right" ng-href="/api/order/history/export">导出Excel</a></h1>

  <div class="well table-well">
    
    <div class="table-responsive">
      <table class="table table-striped table-bordered">
        <thead>
          <tr>
            <th>单号</th>
            <th>发布企业</th>
            <th>始发城市</th>
            <th>到达城市</th>
            <th>司机</th>
            <th>车辆</th>
            <th>交单日期</th>
            <th>发票号</th>
            <th>#</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="order in vm.orders">
            <td><a ng-click="vm.viewDetail(order.id)">{{order.orderId}}</a></td>
            <td>{{order.shipper.enterpriseName}}</td>
            <td>{{order.fromCity}}</td>
            <td>{{order.toCity}}</td>
            <td>{{order.driver.name}}</td>
            <td>{{order.vehicle.vehicleNumber}}</td>
            <td>{{order.completedTime| date:"yyyy-MM-dd"}}</td>
            <td>{{order.invoice.invoiceNumber}}</td>
            <td>
                <a class="btn btn-primary btn-mini" ng-click="vm.viewDetail(order.id)">查看</a>
                <a ng-show="order.status>3" id="map_{{order.orderId}}_{{order.vehicle.id}}" onclick='openWindow(this.id)'  class="btn btn-mini btn-info">查看地图</a>
                <a ng-show="order.status>3" ng-href="/api/location/export/order/{{order.orderId}}"  class="btn btn-mini btn-info">导出数据</a>
            </td>
          </tr>
          
        </tbody>
      </table>
    </div>
    <p ng-show="vm.noRecord">没有找到符合条件的数据！</p>
  </div>
  <div class="pagination pagination-centered" ng-show="!vm.noRecord">
        <ul>
         <li ng-class="vm.firstPage? 'disabled':''" ng-switch="vm.firstPage">
         <a ng-switch-when="false" ng-click="vm.loadPage(vm.currentPage-1)" >&laquo;</a>
         <a ng-switch-when="true" >&laquo;</a>
         </li>
          <li ng-repeat="me in vm.pages" ng-class="me==vm.currentPage? 'active':''" ng-switch="me==vm.currentPage">
            <a ng-switch-when="false" ng-click="vm.loadPage(me)" >{{me}}</a>
            <a ng-switch-when="true" >{{me}}</a>
            </li>
          <li ng-class="vm.lastPage? 'disabled':''" ng-switch on="vm.lastPage">
          <a ng-switch-when="false" ng-click="vm.loadPage(vm.currentPage+1)">&raquo;</a>
          <a ng-switch-when="true" >&raquo;</a>
          </li>
        </ul>
      </div>

</div>